home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / -commercial- / golded_demo / installdata / autorun / golded.rexx
OS/2 REXX Batch file  |  1999-04-28  |  3KB  |  118 lines

  1. /* $VER: 1.0, ©1998 Dietmar Eilert */
  2.  
  3. options results                             /* enable return codes     */
  4.  
  5. if (left(address(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.  
  7.     address 'GOLDED.1'
  8.  
  9. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  10.  
  11. if (RC ~= 0) then
  12.  
  13.     exit
  14.  
  15. options failat 6                            /* ignore warnings         */
  16.  
  17. signal on syntax                            /* ensure clean exit       */
  18.  
  19. /* ---------------------- INSERT YOUR CODE HERE ---------------------- */
  20.  
  21. 'QUERY CAT'
  22.  
  23. if (RESULT = "deutsch") then do
  24.  
  25.     STRING.sCOMPLETING = "Vervollständigung der Installation"
  26.     STRING.sGRAPHICS   = "Welche Grafikhardware ist auf diesem*nRechner installiert ?"
  27.     STRING.sOPTIONS    = "!Amiga-Grafik|Grafikkarte|UAE"
  28.     STRING.sCACHE      = "Cache für Grafiken aktivieren ?*n*nDer Cache beschleunigt den Start,*nbenötigt aber 50-200 KB Speicher."
  29.  
  30.     STRING.sCACHESKIP  = "!AKTIVIEREN|Kein Cache"
  31. end
  32. else do
  33.  
  34.     STRING.sCOMPLETING = "Completing installation"
  35.     STRING.sGRAPHICS   = "What graphics hardware is installed*non this computer ?"
  36.     STRING.sOPTIONS    = "!Amiga Graphics|Graphics Card|UAE"
  37.     STRING.sCACHE      = "Enable cache for images ?*n*nThe cache reduces the startup time*nbut requires 50-200 K RAM."
  38.     STRING.sCACHESKIP  = "!ENABLE|No cache"
  39. end
  40.  
  41. 'REQUEST STATUS="' || STRING.sCOMPLETING || '"'
  42.  
  43. /* get user name and serial number */
  44.  
  45. RESULT = open('env', "golded:etc/env/name", 'READ')
  46.  
  47. if (RESULT ~= 0) then do
  48.  
  49.     USER = readln('env')
  50.  
  51.     'FIX VAR=USER'
  52.  
  53.     'SET USER VALUE="' || USER || '"'
  54.  
  55.     RESULT = close('env')
  56. end
  57.  
  58. RESULT = open('env', "golded:etc/env/serial", 'READ')
  59.  
  60. if (RESULT ~= 0) then do
  61.  
  62.     SERIAL = readln('env')
  63.  
  64.     'SET SERIAL VALUE="' || SERIAL || '"'
  65.  
  66.     RESULT = close('env')
  67. end
  68.  
  69. /* query graphics hardware */
  70.  
  71. 'REQUEST TITLE="' || STRING.sCOMPLETING || '" BODY="' || STRING.sGRAPHICS || '" BUTTON="' || STRING.sOPTIONS || '"'
  72.  
  73. if (RC = 0) then do
  74.  
  75.     /* request simple refresh if running with Amiga hardware */
  76.  
  77.     if (RESULT = 1) then
  78.         'REGEDIT KEY=59 DEEP NUMBER=0'
  79.     else
  80.         'REGEDIT KEY=59 DEEP NUMBER=1'
  81. end
  82.  
  83. /* enable/build cache */
  84.  
  85. 'REQUEST TITLE="' || STRING.sCOMPLETING || '" BODY="' || STRING.sCACHE || '" BUTTON="' || STRING.sCACHESKIP || '"'
  86.  
  87. if (RC = 0) then do
  88.  
  89.     if (RESULT = 1) then do
  90.  
  91.         'REGEDIT KEY=89 DEEP NUMBER=1'
  92.  
  93.         'IMAGES VALIDATE'
  94.     end
  95.     else do
  96.  
  97.         'IMAGES RESET'
  98.  
  99.         'REGEDIT KEY=89 DEEP NUMBER=0'
  100.     end
  101. end
  102.  
  103. 'REQUEST STATUS=""'
  104.  
  105. 'prefs global save'
  106.  
  107. /* ------------------------- END OF YOUR CODE ------------------------ */
  108.  
  109. 'UNLOCK'                                    /* unlock GUI              */
  110.  
  111. exit
  112.  
  113. SYNTAX:
  114.  
  115. SAY "Error in line" SIGL ":" ERRORTEXT(RC)
  116.  
  117. 'UNLOCK'
  118.